<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let s = "";
        let s1 = s || "中国";
        console.log("s1 = ",s1);

        console.log("1 == '1'",1 == '1');
        console.log("'' == false",'' == false); 
        console.log("0 == ''",0 == ''); // 零值相等
        console.log("0 == '0'",0 == '0'); // 数据类型：数值自动转换
        console.log("'0' == ''",'0' == '');

        console.log('null == 0',null == 0); // false


        // ES5默认值：如果前者为0值，取后者。但实际开发中，通常是前者为null或者undefined才取后者。
        let a = 2 || 1;
        console.log("a = ",a);

        // &&与||相反：如果前者不为null值或0值，取后者。
        let c = 3 && 0;
        console.log("c = ",c);

        let b = 2 && 1 || 3 && 0;
        console.log("b = ",b);
    </script>
</body>
</html>